/**
 * <p>Copyright (c) 2011 深圳市鹏途信息技术有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	东莞交通工程质量监督综合业务系统        </p>
 * <p>创建者   :	Administrator 
 * 
 * <p>描   述  :   DetectOrganization.java for com.pengtu.entity.project    </p>
 * 
 * <p>最后修改 : $: 2011-8-25-下午02:06:57 v 1.0.0	 Administrator   $     </p>
 * 
*/

package com.pengtu.entity.project;

import java.util.List;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.google.common.collect.Lists;
import com.pengtu.entity.app.Organization;

/**
 * 
 * DetectOrganization
 * 
 * 2011-8-25 下午02:06:57
 * 
 * @version 1.0.0
 * 
 */
@Entity
@DiscriminatorValue("5")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class DetectOrganization extends Organization{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private DetectOrganization organization;		//上级单位
	
	private List<DetectOrganization> childrenOrgans = Lists.newArrayList();
	
	@ManyToOne(targetEntity=Organization.class)
	@JoinColumn(name="FATHERORGAN")
	public DetectOrganization getOrganization() {
		return organization;
	}
	public void setOrganization(DetectOrganization organization) {
		this.organization = organization;
	}
	
	@OneToMany(mappedBy="organization")
	public List<DetectOrganization> getChildrenOrgans() {
		return childrenOrgans;
	}
	public void setChildrenOrgans(List<DetectOrganization> childrenOrgans) {
		this.childrenOrgans = childrenOrgans;
	}
}
